<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Logistics;

class LogisticsController extends Controller
{
    public function index()
    {
        return view('home.logistics.index');
    }

    public function search(Request $request)
    {
        $phone = $request->get('phone');
        $data = Logistics::where('accept_phone',$phone)->orderBy('sent_at','desc')->get();
        if($data->count()){
            return ['code'=>0,'msg'=>'查询成功','data'=>$data];
        }
        return ['code'=>1,'msg'=>'未查询到相关信息'];
    }

}
